const mongoose = require('./db');
const Schema = mongoose.Schema;
const ArticleSchema =  new Schema({
    title:{type:String,unique:true},
    cid:{
        type:Schema.Types.ObjectId,
        /* 和文章分类建立关系 */
        ref:'articlecate'
    },
    author_name:{
        type: String
    },
    author_id:{
        type:Schema.Types.ObjectId ,
        /* 和用户表关联 */
        ref:'user'
    },
    description:String,
    content:String
})
module.exports = mongoose.model('Article',ArticleSchema,'article');